#include "unp.h"

int main(int argc, char** argv)
{
  int fd, n;
  char buf[8192] = {'\0'};
  
  if (argc != 2)
  {
    printf("usage: mycat <filename>\n");
    exit(-1);
  }

  fd = my_open(argv[1],O_RDONLY);
  if (fd < 0)
  {
    printf("cannot open %s\n",argv[1]);   
  }
  
  while ( (n=read(fd,buf,sizeof(buf))) > 0)
  {
    write(STDOUT_FILENO,buf,n);
  }

  return 0;
}
